cmake_minimum_required(VERSION 3.26)

project(CelestialBeing VERSION 0.0)

enable_language(CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Check for compiler support
message("Compiler: ${CMAKE_CXX_COMPILER_ID}")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    message("GNU Compiler, Version ${CMAKE_CXX_COMPILER_VERSION}")
    if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 12.0)
        # std::format requires this.
        message(FATAL_ERROR "GCC version must be at least 12.0")
    endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
    message("MSVC Compiler, Version ${CMAKE_CXX_COMPILER_VERSION}")
    if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 16.10)
        # std::format requires this.
        message(FATAL_ERROR "MSVC version must be at least 16.10")
    endif()
else()
    message(FATAL_ERROR "Unsupported compiler")
endif ()
add_subdirectory(common)

add_subdirectory(tests)